import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'AplusHomePage.dart';
import 'dart:async';
import 'package:dio/dio.dart';
import 'dart:async';
import 'package:aweb5/pages/WrongPage.dart';
import 'Dispatch.dart';
class StartPage extends StatefulWidget {
  @override
  State<StartPage> createState() => _StartPageState();
}

class _StartPageState extends State<StartPage> {
  List<String> image = List();
  int index = 0;
  NeverScrollableScrollPhysics neverScrollableScrollPhysics =NeverScrollableScrollPhysics();
  dynamic temp = ScrollPhysics();
  var timer;
  @override
  void initState() {
    super.initState();
    timer = new Timer(const Duration(milliseconds: 1500), () {
      try {
        Navigator.of(context).pushAndRemoveUntil(new MaterialPageRoute(
            builder: (BuildContext context) => new Dispatch()), (//跳转到主页
            Route route) => route == null);
      } catch (e) {

      }
    });

    image.add("assets/second.jpg");
    image.add("assets/third.jpg");
    image.add("assets/first.jpg");




  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: new Container(
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
        color: Color.fromRGBO(0, 0, 0, 0),
        child: Image.asset("assets/start.jpg",fit: BoxFit.fill,)
//        new Swiper(
//
//          itemBuilder: (BuildContext context, int index) {
//            return new
//            InkWell(
//              child: Image.asset(image[index],
//                  fit: BoxFit.fill,
//                  height: MediaQuery.of(context).size.height ),
//              onTap: (){
//                if(index==2){
//
//
//                  Navigator.of(context).pushReplacement(new MaterialPageRoute(builder: (con){
//                    return new HomePage();
//                  }));
//                }
//              },
//            );
//
//          },
//          itemCount: image.length,
//          autoplay: false,
//          loop: false,
//          onIndexChanged: (int s) {
////               setState(() {});
//          index = s;
//          if(index==2){
//
//
//          }
//          },
//          pagination:
//////          new SwiperPagination(builder: SwiperPagination.fraction),
//          new SwiperPagination(
//              builder: DotSwiperPaginationBuilder(
//                color: Colors.transparent,
//                activeColor: Colors.transparent,
//              )),
//        ),

 //     ),


    ));
  }




}